<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick()">
      <el-tab-pane label="待审核" name="1"> </el-tab-pane>
      <el-tab-pane label="已审核" name="2"> </el-tab-pane>
      <List :type="type" />
      <Audit />
    </el-tabs>
  </div>
</template>
<script>
import Bus from "@/utils/bus.js";
export default {
  components: {
    List: () => import("./List.vue"),
    Audit: () => import("./Audit.vue"),
  },
  data() {
    return {
      activeName: "1",
      type: this.$route.meta.type,
    };
  },
  watch: {
    $route(v) {
      this.activeName = "1";
      this.type = v.meta.type;
    },
  },
  methods: {
    handleClick() {
      let auditStatus = this.activeName == 1 ? "1" : "2A3";
      Bus.$emit("refreshCourseList", { auditStatus });
    },
  },
};
</script>